home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / bbsckit / bbscdef.h < prev    next >
C/C++ Source or Header  |  1979-12-31  |  7KB  |  160 lines

  1. /*
  2.         bbscdef.h
  3.  
  4.         Global defines and storage definitions for use by
  5.         BBSc system.
  6.  
  7.         NOTE:   BDS C treats global variable like a FORTRAN COMMON
  8.                 block, hence all programs that use these externals
  9.                 must define them in the same order and for the same
  10.                 length, AND they all must be recompiled if you change
  11.                 anything in here!
  12.                                 Mike Kelly
  13.  
  14.         07/23/83 v1.1   Added #define of CLOCK, NOCLOCK, LCDAV, LCEMPTY.
  15.         07/05/83 v1.0   Added #define DEBUG to control compilation
  16.                         of "if(debug)" code.
  17.         07/03/83 v1.0   Added stop_that (indicates a ctl-K or K received
  18.                         deleted).
  19.                         from the keyboard in portout routine).
  20.         06/28/83 v1.0   Added msg_delete (indicates if message is
  21.         06/25/83 v1.0   updated
  22.         05/17/83 v1.0   written
  23. */
  24.  
  25. /*
  26. #define DEBUG     1                     /* comment this out so the */
  27.                                         /*  "if(debug)" code does NOT */
  28.                                         /*  get compiled */
  29.  
  30.  
  31. /*
  32. #define CLOCK     1                     /* if you have a clock board then */
  33.                                         /*  this define wants to be  */
  34.                                         /*  uncommented and NOCLOCK should */
  35.                                         /*  be commented */
  36.  
  37. #define NOCLOCK   1                     /* uncomment this if you do NOT have */
  38.                                         /*  a clock board */
  39.  
  40.  
  41. /* --------------------------------------------------------------------- */
  42. #include <stdio.h>
  43. #define MAXLINE 132
  44. #define CPMEOF 0x1a
  45. #define TRUE      1
  46. #define FALSE     0
  47. #define ERROR    -1
  48. #define OK        1
  49. #define READ      0
  50. #define WRITE     1
  51. #define UPDATE    2
  52. #define STDIN     0
  53. #define STDOUT    1
  54. /* --------------------------------------------------------------------- */
  55.  
  56. #define CLEAR     'E'                   /* clear screen on z-19 */
  57. #define ESC       0x1b
  58. #define CR        0x0d
  59. #define LF        0x0a
  60. #define BELL      0x07                  /* Avon calling */
  61. #define CRLF      "\r\n"                /* <cr><lf> */
  62. #define CTL_D     0x04                  /* <ctl-d> */
  63. #define CTL_K     0x0b                  /* <ctl-k> */
  64. #define CTL_X     0x18                  /* <ctl-x> */
  65.  
  66. #define BREAKCNT  5000                  /* max count to allow for    */
  67.                                         /*   status routines to loop */
  68. #define STATMAX   2000                  /* used by stat debug routine */
  69.  
  70. #define WELCOME   "/z/welcome.bbs"      /* file name */
  71. #define BULLETINS "/z/bulletin.bbs"     /* file name */
  72. #define NEWUSER   "/z/newuser.bbs"      /* file name */
  73. #define SYSTEM    "/z/system.bbs"       /* file name */
  74. #define CALLERS   "/z/callers.bbs"      /* file name */
  75. #define LASTCALL  "/z/lastcall.bbs"     /* file name */
  76. #define USERS     "/z/users.bbs"        /* file name */
  77. #define HEADER    "/z/header.bbs"       /* file name */
  78. #define MESSAGES  "/z/messages.bbs"     /* file name */
  79. #define HELP      "/z/help.bbs"         /* file name */
  80.  
  81. /*      defines used by the bbscfile.c routine     */
  82.  
  83. #define MSG1MAX 104             /* max. piece of message to put in 128 */
  84.                                 /*  byte chunk of msg file */
  85. #define MSGSECT 128             /* size of message sector */
  86.  
  87. /*                      end of defines used by the bbscfile.c routine */
  88.  
  89.                                 /* global variables */
  90. char    portin();               /* in routine returns a character */
  91. char    *gb4sin();              /* returns pointer to character */
  92.  
  93. FILE    *inbuf ;                /* handy input buffer pointer */
  94. FILE    *otbuf ;                /* another handy buffer pointer */
  95. FILE    *itbuf ;                /* pointer used to read/write user file */
  96.  
  97. char    w_fname[25];            /* first name on signon */
  98. char    w_lname[25];            /* last  name on signon */
  99. char    w_password[10];         /* password   on signon */
  100. char    *passptr;               /* ptr to password */
  101.  
  102.                                 /* define user file fields */
  103. char    u_fname[25];
  104. char    u_lname[25];
  105. char    u_password[5];
  106. char    u_time1[12];            /* first time on system */
  107. char    u_date1[9];             /* first date on system */
  108. char    u_time2[12];            /* last  time on system */
  109. char    u_date2[9];             /* last  date on system */
  110. char    u_city[31];             /* city, state */
  111.  
  112.                                 /* define message file fields   */
  113. char    msg_no[11];             /* message number */
  114. char    msg_date[9];            /* date of message */
  115. char    msg_time[15];           /* time of message */
  116. char    msg_to[21];             /* who message is to */
  117. char    msg_from[21];           /* who message is from */
  118. char    msg_pass[11];           /* password */
  119. char    msg_subject[21];        /* what it's all about */
  120. char    msg_text[842];          /* text of message 20 lines */
  121.                                 /*  by 40 wide */
  122. char    msg_delete[2];          /* indicates msg status */
  123.                                 /*  0 = active */
  124.                                 /*  9 = deleted */
  125.  
  126.  
  127. int     debug;                  /* switch for debug mode */
  128. int     offline;                /* switch for offline mode */
  129. int     xpert;                  /* switch */
  130. int     active;                 /* indicates if logged on */
  131. int     statcnt;                /* count used for status routines */
  132. int     stop_that;              /* switch - true indicates ctl-K */
  133.                                 /*  or K received in portout routine */
  134.                                 /* date/time fields - used by bbsclock.c */
  135. char    mm[3];
  136. char    dd[3];
  137. char    yy[3];
  138. char    month[20];              /* ie. January */
  139. char    day[3];                 /* dd */
  140. char    year[5];                /* 19yy */
  141. char    date[30];               /* ie. January 31, 1983 */ 
  142. char    week[20];               /* day of week Monday, Tuesday... */
  143. char    ttime[12];              /* time of day  HH:MM:SS xM */
  144.                                 /*          where x = A or P */
  145.  
  146. /*                      variables used by the bbscfile.c routine */
  147.  
  148. char    h_next_msg[10];         /* next avail. message # */
  149. char    h_date[10];             /* last update date of header file */
  150. int     h_next;                 /* next avail. message # in integer */
  151.  
  152. /*                      end of variables used by bbscfile.c */
  153.  
  154.                         /* end of globals */
  155.  
  156. /* end of program */
  157.  
  158. ext avail. message # in integer */
  159.  
  160. /*                      end of variables used by bbscfile.c *